home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DEBUG / WATCHES / WATCHES2.TXT < prev    next >
Text File  |  1996-06-21  |  3KB  |  117 lines

  1. (*
  2. WATCHES2 TXT   :based upon file "WATCHES.TXT", giving an example for
  3.                 ASM registers as watches. Probably better to read
  4.                 "watches.txt" first.
  5.                 See/text-search in file WATCHES.TXT for "WATCHES2.TXT".
  6.  
  7.  
  8.  
  9.          ALT-D, R displays the registers, but sometimes you might want to
  10.          see eg. "AL as a char" or decimally rather than hexa-decimally,
  11.  
  12.          program x;
  13.          begin
  14.            ASM
  15.              mov ah, 'a'
  16.              mov al, 'b'
  17.            END
  18.          end.
  19.          ╔═[■]══════════════════════════════ Watches
  20.          ║ al: 98
  21.          ║ al,c: 98
  22.          ║ al,h: $62
  23.          ║ al,mc: 'b'
  24.          ║ ax,h: $6162
  25.          ║ ax,m: 62 61
  26.          ║ ax,mc: 'ba'
  27.          ║ ax,d: 24930
  28.          ║ ax,md: 98 97
  29.          ║ char(ah): 'a'
  30.  
  31.          "AX" as Watches displays 'ba' where AX displayed hexa-decimally
  32.          via ALT-D, R would be 'ab'.
  33.  
  34.          ((
  35.            I would assume, that the debugger stores the variable AX as a
  36.            word variable in memory, which hence "swaps" the bytes
  37.            "as usually" with Intel based systems - as mentioned in file
  38.            Watches.txt under "VALUE & HOW IT IS STORED"
  39.            The ALT-D, R register values have therefore the advantage of
  40.            displaying the 8-bit values "as it is expected" for registers.
  41.          )
  42.  
  43.            WATCHES:
  44.              ax,m: 62 61
  45.              ax,mc: 'ba'
  46.  
  47.            ALT-D, R:
  48.              ╔═[■]══ CPU ════3═╗
  49.              ║ AX 6162 DX 55AD ║
  50.  
  51.  
  52.  
  53.         About not using one line for each Watch as discussed
  54.         in file Watches.txt under "MANY VARS TO DISPLAY"
  55. *)
  56.  
  57.          program x;
  58.          begin
  59.            ASM
  60.              mov ah,97   {'a'}
  61.              mov al,98   {'b'}
  62.              mov bh,99
  63.              mov bl,100
  64.              mov ch,101
  65.              mov cl,102
  66.              mov dh,103
  67.              mov dl,104
  68.            END
  69.          end.
  70.  
  71.          After the above code is run:
  72.  
  73.          ALT-D, R:
  74.            ╔═[■]══ CPU ════3═╗
  75.            ║ AX 6162 DX 6768 ║
  76.            ║ CX 6566 BX 6364 ║
  77.            ║ IP 001F CS 6020 ║
  78.            ║ SI 0264 DS 6025 ║
  79.            ║ DI 015E ES 6025 ║
  80.            ║ SP 3FFE SS 6051 ║
  81.            ║ BP 3FFE         ║
  82.            ║ c=0 z=0 s=0 o=0 ║
  83.            ║ p=1 i=1 a=0 d=0 ║
  84.            ╚═════════════════╝
  85.  
  86.          WATCHES:
  87.            ╔═[■]══════════════════════════════ Watches ═════
  88.            ║ ax,h: $6162
  89.            ║ ax,m: 62 61
  90.            ║ ax,4h: $6162,$6364,$6566,$6768
  91.            ║ al,8m: 62 61 64 63 66 65 68 67
  92.            ║ al,8mc: 'badcfehg'
  93.            ║ al,8: 98,97,100,99,102,101,104,103
  94.            ║ ax,4: 24930,25444,25958,26472
  95.            ║ ax,4c: 24930,25444,25958,26472
  96.  
  97.    As you noticed, "ax,4h" displays ax,bx,cx,dx in just one line, yet
  98.    practically as found with ALT-D, R
  99.  
  100.    The other formats don't seem to be terribly helpful, because of the
  101.    in this case undesirable swapping of word-"variables".
  102.  
  103.  
  104.    BTW, FWIW
  105.      Adding ",c" is unfortunately ignored, if used "by itself":
  106.      Eg. "al,c" displays "al" decimally, but not as a char.
  107.  
  108.      While "swap(ax)" is possible, "swap(ax),mc" is of no avail.
  109.      ║ swap(ax): 25185
  110.      ║ swap(ax),mc: 25185
  111.  
  112.  
  113.  
  114.  
  115. Oct-1995
  116. jC,v960224
  117.